<template>
	<view class="task-wrap">
		<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<!-- 未领取仪器 -->
		<view v-if="current == 0">
			<unclaimed v-if='aa'></unclaimed>
			<unclaimedSbcj v-if='bb'></unclaimedSbcj>
		</view>
		<!-- 待返还仪器 -->
		<view v-if="current == 1">
			<toBeReturned v-if='a'></toBeReturned>
			<toBeReturnedSbcj v-if='b'></toBeReturnedSbcj>
		</view>
		<tabBar></tabBar>
	</view>

</template>

<script>
	import unclaimed from './unclaimed/index.vue'
	import unclaimedSbcj from './unclaimedSbcj/index.vue'
	import toBeReturned from './toBeReturned/index.vue'
	import toBeReturnedSbcj from './toBeReturnedSbcj/index.vue'
	export default {
		components: {
			unclaimed,
			unclaimedSbcj,
			toBeReturned,
			toBeReturnedSbcj
		},
		data() {
			return {
				list: [{
					name: '未领取仪器'
				}, {
					name: '待返还仪器'
				}],
				current: 0,
				a: false,
				b: false,
				aa: false,
				bb: false,
			}
		},
		onLoad(e) {
			console.log(e)
			if (e.sbcj == "sbcj") {
				this.a = false
				this.b = true
				
				this.aa = false
				this.bb = true
			} else {
				this.a = true
				this.b = false
				
				this.aa = true
				this.bb = false
			}
		},
		methods: {
			change(index) {
				this.current = index;
			}
		}
	}
</script>

<style>
</style>